<?php
	//header("Content-Type:text/html;charset=utf-8");

	include_once("conn.php");
	$sql="insert into link(webname,webaddress) values('".$_POST["link_name"]."','".$_POST["link_address"]."')";
	$sql2="select lid from link where webname='".$_POST["link_name"]."'";
	$result2;
	if($_POST["is_link_submit"]=="yes")
	{
		mysql_query($sql);
		$result2=mysql_query($sql2);
		while($got_result2=mysql_fetch_array($result2))
		{
			$got_lid=$got_result2["lid"];
		}

	}
	$sql3="insert into cate_link(cid,lid) values('$_POST[cname]','$got_lid')";
	mysql_query($sql3);
?>